package com.commerce.controller.wx;

import com.commerce.common.WXJsonResult;
import com.commerce.model.User;
import com.commerce.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * @author wyj
 * @Title:
 * @Description:
 */
@Controller
@RequestMapping(value="/wx" , method = RequestMethod.POST)
public class WXLoginController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping("login")
    public WXJsonResult login( String code , HttpSession session){
        return userService.login(code,session);
    }
}
